// invoked by spawn.
